package com.zuoye.text7;


import java.sql.SQLException;

public class Fun1 {
    public static void main(String[] args) throws SQLException {
        NewsDaoImpl3 newsDao=new NewsDaoImpl3();



        //查
        /*List<News> newsList=newsDao.getNewsList();
        for(News news:newsList){
            System.out.println(news.getId()+"\t"+news.getNewsId() + "\t" +"\t"+news.getContent()+"\t"+news.getAuthor()+"\t"+news.getIp() +"\t" +news.getCreateDate());
        }*/



        //增
        /*News news = new News();
        news.setNewsId(2);
        news.setContent("国际");
        news.setAuthor("1");
        news.setIp("2");
        news.setCreateDate(new Date());
        newsDao.add(news);*/


        //删
        /*newsDao.delete(5);
*/

        //改
        News3 news1 = new News3();
        news1.setContent("php1");
        news1.setId(2);

        newsDao.update(news1);
    }


}
